import Vue from 'vue'
import Router from 'vue-router'
import Auth from './views/Auth.vue'
import AuthLogin from './views/pages/auth/Login.vue'
import AuthRegister from './views/pages/auth/Register.vue'
import Guide from './views/Guide.vue'
import Logs from './views/Logs.vue'
import Talk from './views/Talk.vue'
import TalkStart from './views/pages/talk/Start.vue'
import TalkWhom from './views/pages/talk/Whom.vue'
import TalkIntent from './views/pages/talk/Intent.vue'
import TalkEnd from './views/pages/talk/End.vue'
import TalkNotice from './views/pages/talk/Notice.vue'
import Settings from './views/Settings.vue'
import SettingsIndex from './views/pages/settings/Index.vue'
import SettingsUser from './views/pages/settings/User.vue'
import SettingsEnd from './views/pages/settings/End.vue'
import SettingsDevice from './views/pages/settings/Device.vue'
import SettingsCloud from './views/pages/settings/Cloud.vue'
import SettingsAbout from './views/pages/settings/About.vue'
import Sidebar from './views/sub/Sidebar.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/guide/:step?',
      name: 'guide',
      component: Guide,
      props: true
    },
    {
      path: '/',
      name: 'logs',
      component: Logs
    },
    {
      path: '/auth',      
      component: Auth,
      children:[
        {path: 'login',name:'login',component:AuthLogin},
        {path: 'register',name:'register',component:AuthRegister},        
    ]
    },
    {
      path: '/talk/:step?',
      //name: 'talk',
      component: Talk,
      children:[
        {path: '',name:'talk_empty',component:TalkStart},
        {path: 'start',name:'start',component:TalkStart},
        {path: 'whom',name:'whom',component:TalkWhom},
        {path: 'intent',name:'intent',component:TalkIntent},
        {path: 'end',name:'end',component:TalkEnd},
        {path: 'notice',name:'notice',component:TalkNotice},
    ]
    },
    {
      path: '/settings',
      //name: 'settings',
      components: { default: Settings, sidebar: Sidebar },
      children:[
        {path: '',name:'settings',component:SettingsIndex},
        {path: 'user',name:'settings_user',component:SettingsUser},
        {path: 'end',name:'settings_end',component:SettingsEnd},
        {path: 'device',name:'settings_device',component:SettingsDevice}, 
        {path: 'cloud',name:'settings_cloud',component:SettingsCloud}, 
        {path: 'about',name:'settings_about',component:SettingsAbout}, 
    ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ]
})
